﻿<!DOCTYPE HTML>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<title></title>
		<!-- <link href="http://www.yueguangbaika.com/h5/init/css/mui.min.css" rel="stylesheet" /> -->

	</head>
	<style type="text/css">
		.list{
			margin-top: 8px;
		}
	</style>
<body>
	
	<header class="mui-bar mui-bar-nav ygbk-head headTop ygbk-headt">
		<a class="mui-icon mui-pull-left" onclick="javascript:history.go(-2);"></a>
		<h1 class="mui-title">银行卡</h1>
	</header>
	<div style="padding-top: 44px;">
	<p class="list">姓名：{$data.name}</p>
	<p class="list">身份证号：{$data.id_card}</p>
	<p class="list">银行卡号：{$data.card_no}</p>
	<p class="list">银行预留手机号：{$data.bind_mob}</p>
	<p class="list">签约结果：<label id="result">未签约</label></p>
	</div>
	<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
	<script type="text/javascript" src="https://wap.lianlianpay.com/lib/llpay.min.js" charset="utf-8"></script>
	<script>
		var jsonobj = {};
		//选择签约还是支付
		var useSign = true;
		//签约模拟创单
		var signCreateUrl = 'https://fourelementapi.lianlianpay.com/repay/signcreatebill';
		//支付模拟创单
		var payCreateUrl = 'https://fourelementapi.lianlianpay.com/repay/paycreatebill';

		jsonobj.api_version = '1.0';
		jsonobj.flag_chnl   = '3';
		jsonobj.no_order    = '2017111555551021';
		jsonobj.oid_partner = '201709220000945943';
		jsonobj.time_stamp  = '20171115205135';
		jsonobj.user_id     = '4268';
		jsonobj.token       = '7D34AD09618E5F8A7377FC978096A7EC';



		var moneyOrder = '0.01';
		var actionURL = useSign?signCreateUrl:payCreateUrl;
		if (!useSign) {
			jsonobj.money_order = moneyOrder;
		}

		new LLPay().setData(JSON.stringify(jsonobj)).signReq(function(data){
			console.log("SignReturnedData:"+JSON.stringify(data));
			if(data.ret_code=='0000'){
				$.ajax({
					url:window.location.href,
					success:function(data) {
						console.log("更新数据:"+JSON.stringify(data));
						document.getElementById('result').innerHTML = data.msg;
						if(data.code == '200'){
							document.getElementById('result').style.color = '#4caf50';
						}else{
							document.getElementById('result').style.color = '#ff9800';
						}
					}
				});
			}else{
				document.getElementById('result').innerHTML = data.ret_msg;
				document.getElementById('result').style.color = '#ff9800';
			}
		});
	</script>
</body>
</html>